package com.zzj.hotel.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.zzj.hotel.core.entity.Message;
import com.zzj.hotel.dao.MessageDao;
import com.zzj.hotel.service.MessageService;

public class MessageServiceImpl implements MessageService {
	private MessageDao messageDao;

	public MessageDao getMessageDao() {
		return messageDao;
	}

	public void setMessageDao(MessageDao messageDao) {
		this.messageDao = messageDao;
	}

	public Message findById(String id) {
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put(Message.MESSAGE_ID, id);
		return messageDao.selectOne(queryMap);
	}

	public List<Message> findAll() {
		return messageDao.selectList(null);
	}

	public List<Message> findList(String articleId) {
		Map<String, Object> queryMap = new HashMap<String, Object>();
		queryMap.put(Message.MESSAGE_ARTOCLEID, articleId);
		return messageDao.selectList(queryMap);
	}

	public void addMessage(Message message) {
		messageDao.insert(message);
		
	}
}
